﻿using System;

namespace Entities
{
    public class Product
    {
        public int ID { get; set; }
        public int ID_MENUURL { get; set; }
        public string CODE { get; set; }
        public string NAME { get; set; }
        public string DESCRIPTION { get; set; }
        public Int64 PRICE { get; set; }
        public Int32 WEIGHT { get; set; }
        public DateTime CREATE_DATE { get; set; }
        public string IMAGE_DIRECTORY { get; set; }
        public string STAT_STOCK { get; set; }
        public string OTHER_NAME { get; set; }
        public string ORIGIN { get; set; }
        public string STORAGE_TIME { get; set; }
        public decimal SALE { get; set; }
        public string IS_DISPLAY { get; set; }
        public int SEQUENCE { get; set; }
        public string STAT_STOCK_NAME
        {
            get
            {
                if (!String.IsNullOrEmpty(STAT_STOCK))
                {
                    if (STAT_STOCK == "O")
                        return "Hết hàng";
                    else if (STAT_STOCK == "C")
                        return "Sắp có";
                    else
                        return "Còn hàng";
                }
                else
                {
                    return "";
                }
            }
        }
        public bool blnDisplay
        {
            get
            {
                if (!String.IsNullOrEmpty(IS_DISPLAY))
                {
                    if (IS_DISPLAY == "T")
                        return true;
                    else
                        return false;
                }
                else
                {
                    return true;
                }
            }
            set
            {
                if (value)
                {
                    IS_DISPLAY = "T";
                }
                else
                {
                    IS_DISPLAY = "F";
                }
            }
        }  
    }
}
